
#include <stdint.h>
#include "os.h"

static uint64_t os_ticks = 0;

void SysTick_Handler(void)
{		
	CPU_SR_ALLOC();

	if(OSRunning == 1)
	{
        os_ticks++;
		OS_CRITICAL_ENTER();
		OSIntEnter();
		OS_CRITICAL_EXIT();
		OSTimeTick();
		OSIntExit();
	}
}

uint64_t get_os_ticks(void) {
    return os_ticks;
}